package com.share.admin.init;

import com.share.admin.service.IDictionaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Slf4j
@Component
public class DictionaryInit {
    @Autowired
    private IDictionaryService dictionaryService;

    @PostConstruct
    @Scheduled(cron = "0 0/7 * * * ?")
    public void initDictionary() {
        log.info("---正在初始化dictionaryService---");
        dictionaryService.init();
    }
}
